<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 使用媒体查询，根据不同的视口宽度，设置不同的根字号 */
    @media (width:320px) {
      html {
        font-size: 20px;
      }
    }

    @media (width:375px) {
      html {
        font-size: 40px;
      }
    }
  </style>
</head>

<body>

</body>

</html>